﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;


namespace QuantumEngine
{
    public partial class EditQuestRoot : UserControl
    {
        public GameObj Active
        {
            get
            {
                return mActive;
            }
            set
            {
                mActive = value;
                if (mActive != null)
                {
                    GrabQuestDetails();
                }
                else
                {
                   
                }
            }
        }

        private void GrabQuestDetails()
        {
            QuestName.Text = mActive.Name;
            QuestInfo.Text = mActive.Info;

        }
        private GameObj mActive = null;

        public EditQuestRoot()
        {
            InitializeComponent();
        }

        private void QuestName_TextChanged(object sender, EventArgs e)
        {
            if (Active != null)
            {
                Active.Name = QuestName.Text;
                QEventEditor.Active.SyncNodeName(Active);
            }
        }

        private void QuestInfo_TextChanged(object sender, EventArgs e)
        {
            if (Active != null)
            {
                Active.Info = QuestInfo.Text;
                QEventEditor.Active.SyncNodeName(Active);
            }
        }

        private void coolButton1_Load(object sender, EventArgs e)
        {

        }

        private void coolButton1_MouseClick(object sender, MouseEventArgs e)
        {
         //   Debug.Log("Generating Event!");
        }

        private void coolButton1_MouseDown(object sender, MouseEventArgs e)
        {
           // Debug.Log("GenEvent2");

        }
    }
}
